public class Main {
    public static void main(String[] args) {
        //自动类型转换(隐式)
        int a = 20;
        byte b = 2;
        a = b;
        System.out.println(a);

        //强制类型转换(显式)
        int c = 15;
        double d = 20.0;
        d = (double) c;
        System.out.println(d);

        //int与long之间：int会被提升为long
        int  e = 20;
        long f = 2222222;
        long g = e + f;
        System.out.println(g);

        //低于 4 个字节的类型, 会先提升成 int
        byte i = 10;
        byte x = 10;
        byte y = (byte)(i + x);
        System.out.println(y);

        //按位异或 ^: 如果两个数字的二进制位相同, 则结果为 0, 相异则结果为 1.
        int l = 10;
        int n = 10;
        int t = 20;
        int z = l ^ n;
        int s = n ^ t;
        System.out.println(z);
        System.out.println(s);
    }
}